// MoldingOHTDoc.h : interface of the CMoldingOHTDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MoldingOHTDOC_H__5393C72A_F68C_4016_9325_57B70C45E5E0__INCLUDED_)
#define AFX_MoldingOHTDOC_H__5393C72A_F68C_4016_9325_57B70C45E5E0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "CrevisFnIO/CrevisFnIO.h"

#include "CommSocket/CommSocket.h"

// Process Layer
#include "AutoManager/AutoManager.h"

// Common Layer
#include "DataManager\CSystemData.h"
#include "DataManager\CDMControlCenter.h"
#include "DataManager\TCPIPLogData.h"

class IIO;

class CMoldingOHTDoc : public CDocument
{
protected: // create from serialization only
	CMoldingOHTDoc();
	DECLARE_DYNCREATE(CMoldingOHTDoc)

	IIO* m_pIO;
	CSystemData* m_pSystemData;
	CDMControlCenter* m_pDMControlCenter;
	IAutoManager* m_pAutoManager;
	CCommSocket* m_pCommManager;

// Attributes
public:
	IIO* GetIOCOM();
	CDMControlCenter* GetDMControlCenterCOM();
	CSystemData* GetSystemDataCOM();
	IAutoManager* GetAutoManagerCOM();
	CTCPIPLogData* m_lnkTCPIPLogData;

	int nRcv;
	BOOL m_bReceive;

	BOOL SendClientMessage(CString strMsg);
	void ServerConnect();
	void ServerDisconnect();
	void CheckReceiveData(CString strReceiveData);
	void SendEQtoCIMData(int nID,CString strReceiveData);

	
	LRESULT OnCloseSocket(WPARAM wParam,LPARAM lParam);
	LRESULT OnReceiveData(WPARAM wParam,LPARAM lParam);
	CCommSocket m_pCommSocket;
	
	UINT m_nServerPort;
	CString m_strServerIP;
	CString m_strUserID;
	CString m_strReceiveData;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMoldingOHTDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual void OnCloseDocument();
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetStatusText(LPCTSTR sText);
	virtual ~CMoldingOHTDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMoldingOHTDoc)
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MoldingOHTDOC_H__5393C72A_F68C_4016_9325_57B70C45E5E0__INCLUDED_)
